package com.atguigu.guli.service.sms.controller;

import com.atguigu.guli.service.base.result.R;
import com.atguigu.guli.service.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "短信服务")
@RestController
@CrossOrigin
@RequestMapping("/api/sms")
public class SmsController {

    @Autowired
    private SmsService smsService;

    // 发送短信接口
    @ApiOperation(value = "获取验证码")
    @GetMapping("SendMsg/{mobile}")
    public R sendMsg(@PathVariable("mobile") String mobile) {
        // System.out.println("手机号: " + mobile);
        smsService.sendMsg(mobile);
        return R.ok();
    }


}
